package com.bjsxt.controller;

import com.bjsxt.pojo.Employee;
import com.bjsxt.service.EmployeeService;
import com.bjsxt.service.impl.EmployeeServiceImpl;
import com.google.gson.Gson;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/sxt/EmployeeServlet")
public class EmployeeServlet  extends  BaseServlet{

    private EmployeeService  employeeService=new EmployeeServiceImpl();

    //查询上级领导实现
    protected void  empFindMgr(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        List<Employee> list = employeeService.findMgr();

        String json = new Gson().toJson(list);
        resp.getWriter().print(json);
    }
}
